import Vue from 'vue'
import App from './App.vue'
import router from './router'
import store from './store'
import components from '@/components/index'
import common from '@/utils/common'
import * as filters from './filters'
import ElementUI from 'element-ui';
import prettyLog from '@/utils/base-print-log.js'
import { Quill } from "vue-quill-editor"; // 编辑器
import ImageResize from 'quill-image-resize-module'// 编辑器 - 图片缩放组件引用
import { ImageDrop } from "quill-image-drop-module"; // 编辑器 - 图片拖动组件引用

import 'element-ui/lib/theme-chalk/index.css'
import '@/assets/scss/base.css'

Vue.config.productionTip = false

// 自定义字体大小
const sizes = [false, "14px", "16px", "18px", "20px", "22px", "26px", "28px", "30px"];
const Size = Quill.import("formats/size");
Size.whitelist = sizes;
// 自定义字体
const fonts = ["SimSun", "SimHei", "Microsoft-YaHei", "KaiTi", "FangSong", "Arial", "Times-New-Roman", "sans-serif"];
var Font = Quill.import("formats/font");
Font.whitelist = fonts;
Quill.register(Font, true);
Quill.register("modules/imageResize", ImageResize)// 注册
Quill.register("modules/imageDrop", ImageDrop); // 注册


Vue.use(components)
Vue.use(ElementUI)

// 添加实例属性
Object.assign(Vue.prototype, {
  common, // 公共方法 
  $console: prettyLog,
  define: require('./utils/define'), // 常量
})

// 全局注册过滤器
Object.keys(filters).forEach(key => {
  Vue.filter(key, filters[key])
})


new Vue({
  router,
  store,
  render: h => h(App)
}).$mount('#app')
